﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.ComponentModel;

namespace TA.Turbo.Controls
{
	/// <summary>
	/// Displays static text.
	/// </summary>
	public class Literal : TControl
	{
		#region PUBLIC
		#region INIT
		/// <summary>
		/// Ctor.
		/// </summary>
		public Literal()
			: base(HtmlTextWriterTag.Span)
		{
		}
		#endregion
		#region PROPS
		#region DEF
		/// <summary>
		/// Props.
		/// </summary>
		protected static new Properties _clientProperties = Define(BaseValueDisplayControl._clientProperties,
			new BasePropertyDefinition[] {
				new PropertyDefinition<string>("Text", "Tx", null),
			});
		/// <summary>
		/// Props.
		/// </summary>
		public override Properties ClientProperties
		{
			get
			{
				return _clientProperties;
			}
		}
		#endregion
		[Browsable(false)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
		public override HtmlTextWriterTag Tag
		{
			get
			{
				return base.Tag;
			}
			set
			{
				base.Tag = value;
			}
		}
		/// <summary>
		/// Gets or sets the text to be displayed.
		/// </summary>
		[Category("Appearance")]
		public string Text
		{
			get
			{
				return GetProperty<string>("Text");
			}
			set
			{
				ViewState["Text"] = value;
			}
		}
		#endregion
		#endregion
		#region INTERNAL
		#region PROPS
		#endregion
		#region METHODS
		#region INIT
		#endregion
		#region RENDER
		/// <summary>
		/// Renders the <see cref="Text"/> of this control.
		/// </summary>
		/// <param name="writer"></param>
		protected override void Render(HtmlTextWriter writer)
		{
			writer.Write(Text);
		}
		#endregion
		#endregion
		#endregion
	}
}
